﻿using JLSQLBrowser.Controls;
using Office = Microsoft.Office.Core;

namespace JLSQLBrowser
{
    public partial class ThisAddIn
    {
        //Declare your Control
        private TpSqlEdit _taskPaneTpSqlEdit;

        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            //Fire the Custom TaskPane
            AddTpSqlEdit();
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
        }

        //Create the Custom TaskPane and Dock Bottom
        //You must Add your Control here
        private void AddTpSqlEdit()
        {
            _taskPaneTpSqlEdit = new TpSqlEdit();
            var taskPaneTpSqlEdit = this.CustomTaskPanes.Add(_taskPaneTpSqlEdit, "SQL Editor");
            taskPaneTpSqlEdit.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionBottom;
            taskPaneTpSqlEdit.Visible = true;
        }

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }
        
        #endregion
    }
}
